package com.ivi.car.module.reservation.adapter;

import android.graphics.Paint;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseMultiItemQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.ivi.car.R;
import com.ivi.car.bean.ReservationData;

import java.util.List;

/**
 * Created by Administrator on 2018/3/6.
 */

public class ReservationMultitypeItemAdapter extends BaseMultiItemQuickAdapter<ReservationData, BaseViewHolder> {
    public static final int ITEMSTYLE0 = 0;
    public static final int ITEMSTYLE1 = 1;
    public static final int ITEMSTYLE2 = 2;
    public static final int ITEMSTYLE3 = 3;
    public static final int ITEMSTYLE4 = 4;
    public static final int ITEMSTYLE5 = 5;
    public static final int ITEMSTYLE6 = 6;
    public static final int ITEMSTYLE7 = 7;
    public ReservationMultitypeItemAdapter(List<ReservationData> data) {
        super(data);
        addItemType(ITEMSTYLE0, R.layout.reservation_item_store);  //必须设置Item类型,否则空职指针异常
        addItemType(ITEMSTYLE1, R.layout.reservation_item_lnn);
        addItemType(ITEMSTYLE2, R.layout.reservation_item_time);
        addItemType(ITEMSTYLE3, R.layout.reservation_item_contact);
        addItemType(ITEMSTYLE4, R.layout.reservation_item_activity);
        addItemType(ITEMSTYLE5, R.layout.reservation_item_title);
        addItemType(ITEMSTYLE6, R.layout.reservation_item_multiproject);
        addItemType(ITEMSTYLE7, R.layout.reservation_item_singleproject);
    }

    @Override
    protected void convert(BaseViewHolder helper, ReservationData item) {
        switch (item.getItemType()) {  //或采用baseViewHolder.getItemViewType()方式
            case ITEMSTYLE0 : //标题:
//                helper
//                .addOnClickListener(R.id.reservation_item_tv);
                break;
            case ITEMSTYLE1 : //内容
//                helper.setText(R.id.reservation_item_lnn_tv1, item.getNum() + "--");
                TextView reservationItemLnnIv4 = helper.getView(R.id.reservation_item_lnn_txtVi4);
                reservationItemLnnIv4.getPaint().setFlags(Paint.STRIKE_THRU_TEXT_FLAG);
                break;
            case ITEMSTYLE2 : //内容
                break;
            case ITEMSTYLE3 : //内容
                break;
            default:
                break;
        }
    }



}
